<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>平台管理系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="/layuiadmin/layui/css/layui.css"
	media="all">
<link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" type="text/css"
	href="/css/plugins/dropzone/basic.css" />
<link rel="stylesheet" type="text/css"
	href="/css/plugins/dropzone/dropzone.css" />
<link rel="stylesheet" type="text/css"
	href="/css/plugins/layui-formSelect/formSelects-v4.css" />
<link rel="stylesheet" type="text/css" href="/css/plat-style.css" />
<style>
img {
	margin-left: 5px
}
</style>
</head>
<body>
	<div class="layui-col-md12">
		<div class="layui-card">
			<div class="layui-card-header">
				<span class="layui-breadcrumb" lay-filter="breadcrumb">
	              <a href="javascript:;">身份认证</a>
	              <a ><cite>详情</cite></a>
	            </span>
	            <div class="layui-inline" style="float:right;">
					<button type="button" class="layui-btn layui-btn-sm backList">返回列表</button>
	            </div>
			</div>
			<div class="layui-card-body" style="padding: 15px;">
				<div class="layui-tab layui-tab-brief" lay-filter="component-tabs-brief">
					<ul class="layui-tab-title">
						<li class="layui-this">基本资料</li>
						<li>证件信息</li>
						<li>审核信息</li>
					</ul>
					<div class="layui-tab-content">
						<div class="layui-tab-item layui-show">
							<div class="layui-form layui-form-pane layui-tab-item layui-show">
								<div class="layui-form-item">
						        	<label class="layui-form-label">用户昵称</label>
						        	<div class="layui-input-inline">
						        		<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" value="${authen.CNickName }" >
						        	</div>
						        	<div class="layui-form-mid layui-word-aux">${empty authen.CNickName ? '未设置': ''}</div>
						        </div>
								<div class="layui-form-item">
						        	<label class="layui-form-label">用户账户</label>
						        	<div class="layui-input-inline">
						        		<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" value="${authen.CPhone }" >
						        	</div>
						        	<div class="layui-form-mid layui-word-aux">${empty authen.CPhone ? '未设置': ''}</div>
						        </div>
								<div class="layui-form-item">
						        	<label class="layui-form-label">真实姓名</label>
						        	<div class="layui-input-inline">
						        		<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" value="${authen.realName }" >
						        	</div>
						        	<div class="layui-form-mid layui-word-aux">${empty authen.realName ? '未设置': ''}</div>
						        </div>
								<div class="layui-form-item">
						        	<label class="layui-form-label">性别</label>
						        	<div class="layui-input-inline">
						        		<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" 
						        		value="${authen.sex == 0 ? '保密' : (authen.sex == 1 ? '男': '女') }" >
						        	</div>
						        </div>
								<div class="layui-form-item">
						        	<label class="layui-form-label">联系电话</label>
						        	<div class="layui-input-inline">
						        		<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" value="${authen.linkPhone }" >
						        	</div>
						        	<div class="layui-form-mid layui-word-aux">${empty authen.linkPhone ? '未设置': ''}</div>
						        </div>
<%--								<div class="layui-form-item">--%>
<%--						        	<label class="layui-form-label">邮箱</label>--%>
<%--						        	<div class="layui-input-inline">--%>
<%--						        		<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" value="${authen.email }" >--%>
<%--						        	</div>--%>
<%--						        	<div class="layui-form-mid layui-word-aux">${empty authen.email ? '未设置': ''}</div>--%>
<%--						        </div>--%>
<%--								<c:if test="${authen.authType == 1}">--%>
<%--									<div class="layui-form-item">--%>
<%--										<label class="layui-form-label">银行卡</label>--%>
<%--										<div class="layui-input-inline">--%>
<%--											<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" value="${authen.bankCard }" >--%>
<%--										</div>--%>
<%--										<div class="layui-form-mid layui-word-aux">${empty authen.bankCard ? '未设置': ''}</div>--%>
<%--									</div>--%>
<%--								</c:if>--%>
					        </div>
						</div>
						<div class="layui-tab-item">
							<div class="layui-form layui-form-pane layui-tab-item layui-show">
								<div class="layui-form-item">
						        	<label class="layui-form-label">证件号</label>
						        	<div class="layui-input-inline">
						        		<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" value="${authen.idcard }" >
						        	</div>
						        	<div class="layui-form-mid layui-word-aux">${empty authen.idcard ? '未设置': ''}</div>			        	
						        </div>
								<div class="layui-form-item">
									<label class="layui-form-label">长期有效</label>
									<div class="layui-input-inline">
										<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;"
											   value="${authen.isLongLasting == 0  ? '否': '是'}" >
									</div>
								</div>
<%--								<c:if test="${authen.isLongLasting == 0}">--%>
<%--									<div class="layui-form-item">--%>
<%--										<label class="layui-form-label">有效期</label>--%>
<%--										<div class="layui-input-inline">--%>
<%--											<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" value="${authen.expiryDate }" >--%>
<%--										</div>--%>
<%--										<div class="layui-form-mid layui-word-aux">${empty authen.expiryDate ? '未设置': ''}</div>--%>
<%--									</div>--%>
<%--								</c:if>--%>
<%--								<div class="layui-form-item">--%>
<%--						        	<label class="layui-form-label">地址</label>--%>
<%--						        	<div class="layui-input-inline">--%>
<%--						        		<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" value="${authen.addressDetail }" >--%>
<%--						        	</div>--%>
<%--						        	<div class="layui-form-mid layui-word-aux">${empty authen.addressDetail ? '未设置': ''}</div>				        	--%>
<%--						        </div>--%>
<%--								<div class="layui-form-item">--%>
<%--						        	<label class="layui-form-label">证件正面</label>--%>
<%--						        	<div class="layui-input-inline">--%>
<%--						        		<img alt="" src="${authen.front }" width="171px" height="108px">--%>
<%--						        	</div>--%>
<%--						        </div>--%>
<%--						       	<div class="layui-form-item">--%>
<%--						        	<label class="layui-form-label">证件反面</label>--%>
<%--						        	<div class="layui-input-inline">--%>
<%--						      			<img alt="" src="${authen.back }" width="171px" height="108px">--%>
<%--						        	</div>--%>
<%--						        </div>--%>
								<c:if test="${authen.authType != 1}">
									<div class="layui-form-item">
										<label class="layui-form-label">手持证照</label>
										<div class="layui-form-mid layui-word-aux">
											<img alt="" src="${authen.handIdcard }" width="269px" height="226px">
										</div>
									</div>
								</c:if>
							</div>
						</div>
						<div class="layui-tab-item">
							<div class="layui-form layui-form-pane layui-tab-item layui-show">
								<div class="layui-form-item">
						        	<label class="layui-form-label">状态</label>
						        	<div class="layui-input-inline">
						        		<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" 
						        		value="${authen.status == 1 ? '待审核' : (authen.status == 2 ? '认证成功' : '认证失败' )}" >
						        	</div>
						        </div>
						        <c:if test="${authen.status == 3 }">
									<div class="layui-form-item">
							        	<label class="layui-form-label">驳回原因</label>
										<div class="layui-input-inline">
							              <textarea name="text"  class="layui-textarea" disabled style="cursor: not-allowed !important;">${authen.rejectRemark }</textarea>
							            </div>
							        </div>
							    </c:if>	
						        <c:if test="${authen.status != 1 }">
							        <div class="layui-form-item">
							        	<label class="layui-form-label">审核时间</label>
							        	<div class="layui-input-inline">
							        		<input type="text"  class="layui-input" disabled style="cursor: not-allowed !important;" 
							        		value="<fmt:formatDate pattern='yyyy-MM-dd HH:mm' value='${authen.checkTime }' />" >
							        	</div>							        	
							        </div>
						        </c:if>							
							</div>
						</div>
					</div>
				</div>
				<div class="layui-form-item layui-layout-admin">
	                <div class="layui-input-block">
	                	<div class="layui-footer" style="left: 0;">
	                		<c:if test="${authen.status == 1 }">
		                		<button class="layui-btn layui-btn-warm passThis" data-id="${authen.id }" data-status="2" data-type="passThis" type="button">通过</button>
		                  		<button class="layui-btn layui-btn-danger rejectThis" data-id="${authen.id }" data-status="3" data-type="rejectThis" type="button">驳回</button>	                		
	                		</c:if>
	                	</div>
	                </div>
	            </div>
			</div>
		</div>
	</div>
	<script src="/layuiadmin/layui/layui.js"></script>
	<script type="text/javascript" src="/js/jquery/jquery.min.js"></script>
	<script type="text/javascript" src="/js/common.js"></script>
	<script>
		layui.config({
			//静态资源所在路径
			base : '/layuiadmin/'
		}).extend({
			//主入口模块
			index : 'lib/index'
		}).use([ 'index', 'form'],function() {
			var $ = layui.$, admin = layui.admin, element = layui.element, layer = layui.layer;
			
			var active = {
	            passThis:function (id,status,url) {
	                layer.confirm('确定操作吗？', function(){
	                	updateThis(id, status, url);
	                });
	            }, 
	            rejectThis : function (id, status, url) {
	            	layer.prompt({title: '驳回认证申请', formType: 2}, function(text, index){
						$.ajax({
							type: 'post',
							url: url,
							data: {'id': id, 'status': status, 'rejectRemark':text},
							dataType: 'json',
							success: function (data) {
								if (data.status) {
									layer.msg(data.desc);
									setTimeout(function () {
										window.location.reload();
									}, 1000)
								} else {
									layer.msg(data.desc);
								}
							},
							error: function (a,b,c) {
								layer.msg("请检查页面信息是否正确");
							}
						});
					});
	            }
		   	};
			
			$('.backList').on('click',function () {
				history.go(-1);
			});
			
			$('.passThis').on('click',function () {
				var type = $(this).data('type');
	            var id = $(this).data('id');
	            var status = $(this).data('status');
	            var url = "/customer/editAuthenApplyStatus";
	            active[type] && active[type].call(this,id,status,url);
			});
			
			$('.rejectThis').on('click',function () {
				var type = $(this).data('type');
	            var id = $(this).data('id');
	            var status = $(this).data('status');
	            var url = "/customer/editAuthenApplyStatus";
	            active[type] && active[type].call(this,id,status,url);
			});
			
		});
	</script>
</body>
</html>